package com.qianxx.component.activity.switcher.toggle_button;

import android.os.Bundle;
import android.widget.Toast;

import com.qianxx.component.R;
import com.qianxx.component.activity.base.BaseActivity;
import com.qianxx.viewlibrary.switcher.togglebutton.ToggleButton;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ToggleButtonActivity extends BaseActivity {
    @BindView(R.id.toggle_button)
    ToggleButton toggle_button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_toggle_button);
        ButterKnife.bind(this);

        toggle_button.setOnToggleChanged(new ToggleButton.OnToggleChanged() {
            @Override
            public void onToggle(boolean on) {
                Toast.makeText(getApplicationContext(),on+"",Toast.LENGTH_SHORT).show();
            }
        });
    }

    @Override
    public String setTitle() {
        return "ToggleButton";
    }
}
